package com.risetek.tft.service.impl;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class Interceptor {
	
	private static String  f = null;
	
	@Pointcut("@annotation(com.risetek.tft.context.SecurityLog)")
	  public void log(){
		  
	  }
	
	   // @Around("execution(* org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(..))")   
	   // @Before(value = "execution(* com.risetek.tft.action.*.*(..))") 
	@Before("log()")
	    public Object doBasicProfiling(JoinPoint pjp) throws Throwable{  
	        System.out.println("进入环绕通知");  
	        Object object = pjp.getThis();//执行该方法  
	        System.out.println("退出方法");  
	        return null;  
	    }  
	    
	   // @After(value = "execution(* com.risetek.tft.action.*.*(..))") 
	@After("log()")
	    public Object doBasicProfiling2(JoinPoint pjp) throws Throwable{  
	        System.out.println("进入环绕通知2");  
	        Object object = pjp.getThis();//执行该方法  
	        System.out.println("退出方法2");  
	        return null;  
	    }  

}
